Exercise 1

Install and load the rvest package. You can find more information about the package here.

Exercise 2

Go to the Wikipedia entry for the most liked YouTube videos: https://en.wikipedia.org/wiki/List_of_most-liked_YouTube_videos and find the Xpath that corresponds to the whole table on the right side of the screen.
You can do this in Google Chrome by going to the website, right-clicking on the page and clicking on inspect. Alternatively, you can just press Ctrl + Alt + I. By expanding the containers and hovering your mouse over them, you can see which elements on the website they correspond to. To copy the Xpath of an element, right-click on the container and select copy -> Copy full Xpath. Be careful to select the HTML that encompasses the entire table and not only parts of it.

Exercise 3

Using the Xpath, extract the information from the table.
Use the read_html(), html_nodes() and html_table() functions. You can read more about them in the Help panel in RStudio or by calling them preceded by a question mark (e.g., ?read_html()).